package com.tanhua.commons;

import com.tanhua.commons.properties.*;
import com.tanhua.commons.template.*;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties({SmsProperties.class,
                                OssProperties.class,
                               AipFaceProperties.class,
                              ContentCensorProperties.class,
        HuanXinProperties.class
}
)
public class TanhuaCommonsAutoConfiguration {
    @Bean
    public ContentCensorTemplate contentCensorTemplate(ContentCensorProperties contentCensorProperties){
        return  new  ContentCensorTemplate(contentCensorProperties);
    }
    @Bean
    public SmsTemplate smsTemplate(SmsProperties properties){
        return new SmsTemplate(properties);
    }

    @Bean
    public OssTemplate ossTemplate(OssProperties properties){
        return new OssTemplate(properties);
    }

    @Bean
    public AipFaceTemplate aipFaceTemplate(AipFaceProperties properties){

        return new AipFaceTemplate(properties);
    }
    @Bean
    public HuanXinTemplate huanXinTemplate(HuanXinProperties huanXinProperties){
        return new HuanXinTemplate(huanXinProperties);
    }
}
